package implementations;

import interfaces.*;
/**
 * @author Kai Bielenberg
 * @author Oliver Behnke
 *
 */

// Utility Klasse zur Erzeugung der Objecte des ADTs. Hierdurch leichter wechsel zwischen Implementationen m�glich.
public final class Values {

	private Values() {	
	}
	
	// Factorymethoden zur Erzeugung der Objekte
	public static <E,V> Edge<E,V> undirectedEdge(String name, Vertex<V> v1, Vertex<V> v2, E element) {
		return UndirectedEdge.valueOf(name, v1,v2,element);
	}
	
	public static <V> Edge<String,V> undirectedEdge(String name, Vertex<V> v1, Vertex<V> v2) {
		return UndirectedEdge.valueOf(name, v1,v2, name);
	}
	
	   public static <V> Edge<String,V> directedEdge(String name, Vertex<V> v1, Vertex<V> v2) {
	        return DirectedEdge.valueOf(name, v1,v2, name);
	    }
	   
       public static <E,V> Edge<E,V> directedEdge(String name, Vertex<V> v1, Vertex<V> v2, E element) {
           return DirectedEdge.valueOf(name, v1,v2, element);
       }
	
	public static <V> Vertex<V> vertex(String name, V element) {
		return VertexImpl.valueOf(name, element);
	}
	public static Vertex<String> vertex(String name) {
		return VertexImpl.valueOf(name, name);
	}
	
	public static <E,V> Graph<E,V> undirectedGraph(Vertex<V> v){
		return UndirectedGraph.valueOf(v);
	}
	
	public static <V> UndirectedIntegerGraph<V> integerGraph(Vertex<V> v){
		return UndirectedIntegerGraph.valueOf(v);
	}
	
   public static <E,V> Graph<E,V> directedGraph(Vertex<V> v){
        return DirectedGraph.valueOf(v);
    }
   
    public static <V> DirectedIntegerGraph<V> directedIntegerGraph(Vertex<V> v){
        return DirectedIntegerGraph.valueOf(v);
    }
    
    public static <V> FlowGraph<V> flowGraph(Vertex<V> source, Vertex<V> target){
    	return FlowGraphImpl.valueOf(source, target);
    }
    
    public static FlowElem flowElem(int capacity, int flow){
    	return FlowElemImpl.valueOf(capacity, flow);
    }
}


